#define _POSITION_RIGHT 0
#define _POSITION_STAND 1
#define _POSITION_WAITFOR 2
#define _POSITION_HULK 3
#define _POSITION_PUMP_HIGH 4
#define _POSITION_PUMP_LOW 5
#define _POSITION_SEMIPUMP_HIGH 6
#define _POSITION_SEMIPUMP_LOW 7
#define _POSITION_PLANE 8

void set_animation_step(int ms, int what1, int what2, int time)
{
  anim_time = ms;
  switch(what1)
  {
    default: case _POSITION_RIGHT:   set_position_right(anim1_head, anim1_left_arm, anim1_left_leg, anim1_right_arm, anim1_right_leg); break;
    case _POSITION_STAND:   set_position_stand(anim1_head, anim1_left_arm, anim1_left_leg, anim1_right_arm, anim1_right_leg); break;    
    case _POSITION_WAITFOR:   set_position_waitfor(anim1_head, anim1_left_arm, anim1_left_leg, anim1_right_arm, anim1_right_leg); break;
    case _POSITION_HULK:   set_position_hulk(anim1_head, anim1_left_arm, anim1_left_leg, anim1_right_arm, anim1_right_leg); break;
    case _POSITION_PUMP_HIGH:   set_position_pump_high(anim1_head, anim1_left_arm, anim1_left_leg, anim1_right_arm, anim1_right_leg); break;
    case _POSITION_PUMP_LOW:   set_position_pump_low(anim1_head, anim1_left_arm, anim1_left_leg, anim1_right_arm, anim1_right_leg); break;
    case _POSITION_SEMIPUMP_HIGH:   set_position_semipump_high(anim1_head, anim1_left_arm, anim1_left_leg, anim1_right_arm, anim1_right_leg); break;
    case _POSITION_SEMIPUMP_LOW:   set_position_semipump_low(anim1_head, anim1_left_arm, anim1_left_leg, anim1_right_arm, anim1_right_leg); break;
    case _POSITION_PLANE:   set_position_plane(anim1_head, anim1_left_arm, anim1_left_leg, anim1_right_arm, anim1_right_leg); break;
  }
  switch(what2)
  {
    default: case _POSITION_RIGHT:   set_position_right(anim2_head, anim2_left_arm, anim2_left_leg, anim2_right_arm, anim2_right_leg); break;
    case _POSITION_STAND:   set_position_stand(anim2_head, anim2_left_arm, anim2_left_leg, anim2_right_arm, anim2_right_leg); break;    
    case _POSITION_WAITFOR:   set_position_waitfor(anim2_head, anim2_left_arm, anim2_left_leg, anim2_right_arm, anim2_right_leg); break;
    case _POSITION_HULK:   set_position_waitfor(anim2_head, anim2_left_arm, anim2_left_leg, anim2_right_arm, anim2_right_leg); break;
    case _POSITION_PUMP_HIGH:   set_position_pump_high(anim2_head, anim2_left_arm, anim2_left_leg, anim2_right_arm, anim2_right_leg); break;
    case _POSITION_PUMP_LOW:   set_position_pump_low(anim2_head, anim2_left_arm, anim2_left_leg, anim2_right_arm, anim2_right_leg); break;
    case _POSITION_SEMIPUMP_HIGH:   set_position_semipump_high(anim2_head, anim2_left_arm, anim2_left_leg, anim2_right_arm, anim2_right_leg); break;
    case _POSITION_SEMIPUMP_LOW:   set_position_semipump_low(anim2_head, anim2_left_arm, anim2_left_leg, anim2_right_arm, anim2_right_leg); break;
    case _POSITION_PLANE:   set_position_plane(anim2_head, anim2_left_arm, anim2_left_leg, anim2_right_arm, anim2_right_leg); break;
  }
  do_anim(time);
}

void anim_right(int ms)
{
  set_animation_step(ms, _POSITION_RIGHT, _POSITION_RIGHT, 0);
}

void anim_stand(int ms)
{
  set_animation_step(ms, _POSITION_STAND, _POSITION_STAND, 0);
}

void anim_stand2waitfor(int ms)
{
  set_animation_step(ms, _POSITION_STAND, _POSITION_WAITFOR, 0);
}

void anim_waitfor2stand(int ms)
{
  set_animation_step(ms, _POSITION_WAITFOR, _POSITION_STAND, 0);
}

void anim_waitfor2hulk(int ms)
{
  set_animation_step(ms, _POSITION_WAITFOR, _POSITION_HULK, 0);
}

void anim_hulk(int ms)
{
  set_animation_step(ms, _POSITION_HULK, _POSITION_HULK, 0);
}

void anim_hulk2stand(int ms)
{
  set_animation_step(ms, _POSITION_HULK, _POSITION_STAND, 0);
}

void anim_hulk2waitfor(int ms)
{
  set_animation_step(ms, _POSITION_HULK, _POSITION_WAITFOR, 0);
}

void anim_semipump_high(int ms)
{
  set_animation_step(ms, _POSITION_SEMIPUMP_HIGH, _POSITION_SEMIPUMP_HIGH, 0);
}

void anim_semipump_high2low(int ms)
{
  set_animation_step(ms, _POSITION_SEMIPUMP_HIGH, _POSITION_SEMIPUMP_LOW, 0);
}

void anim_semipump_low2high(int ms)
{
  set_animation_step(ms, _POSITION_SEMIPUMP_LOW, _POSITION_SEMIPUMP_HIGH, 0);
}

void anim_pump_high(int ms)
{
  set_animation_step(ms, _POSITION_PUMP_HIGH, _POSITION_PUMP_HIGH, 0);
}

void anim_pump_high2low(int ms)
{
  set_animation_step(ms, _POSITION_PUMP_HIGH, _POSITION_PUMP_LOW, 0);
}

void anim_pump_low2high(int ms)
{
  set_animation_step(ms, _POSITION_PUMP_LOW, _POSITION_PUMP_HIGH, 0);
}
